液状化解析をしてみたので!!

この度,液状化解析をしてみたので,そのご紹介とさせていただきます。

chatgptを利用しました。

import numpy as np

import matplotlib.pyplot as plt

from scipy.integrate import cumtrapz

def generate_earthquake_wave(duration, amplitude, frequency, sampling_rate=100):

    t = np.linspace(0, duration, int(sampling_rate * duration))

    acceleration = amplitude * np.sin(2 * np.pi * frequency * t)

    return t, acceleration

def simulate_soil_response(acceleration, sampling_rate):

    velocity = cumtrapz(acceleration, dx=1/sampling_rate, initial=0)

    displacement = cumtrapz(velocity, dx=1/sampling_rate, initial=0)

    return velocity, displacement

def calculate_pore_pressure(displacement, factor=0.5):

    pore_pressure = factor * np.abs(displacement)  # 孔水圧は変位の関数と仮定

    return pore_pressure

def check_liquefaction(pore_pressure, critical_pressure):

    liquefaction = pore_pressure > critical_pressure

    return liquefaction

パラメータ設定

duration = 10 # 地震の持続時間 (秒)
amplitude = 5 # 地震の加速度の振幅 (m/s^2)
frequency = 2 # 地震の周波数 (Hz)
critical_pressure = 0.3 # 液状化判定のための臨界孔水圧
sampling_rate = 100 # サンプリングレート (Hz)

地震波形生成

t, acceleration = generate_earthquake_wave(duration, amplitude, frequency, sampling_rate)

地盤応答のシミュレーション

velocity, displacement = simulate_soil_response(acceleration, sampling_rate)

孔水圧の計算

pore_pressure = calculate_pore_pressure(displacement)

液状化の判定

liquefaction = check_liquefaction(pore_pressure, critical_pressure)

結果のプロット

plt.figure(figsize=(12, 8))
plt.subplot(311)
plt.plot(t, acceleration, label=’Acceleration (m/s^2)’)
plt.ylabel(‘Acceleration’)
plt.legend()

plt.subplot(312)
plt.plot(t, displacement, label=’Displacement (m)’)
plt.ylabel(‘Displacement’)
plt.legend()

plt.subplot(313)
plt.plot(t, pore_pressure, label=’Pore Pressure’)
plt.fill_between(t, 0, max(pore_pressure), where=liquefaction, color=’red’, alpha=0.5, label=’Liquefaction’)
plt.ylabel(‘Pore Pressure’)
plt.xlabel(‘Time (s)’)
plt.legend()

plt.tight_layout()
plt.show()

Tags:

No responses yet

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

Latest Comments

WP Twitter Auto Publish Powered By : XYZScripts.com